const { DataTypes } = require('../utils/sequelize');

const Course = {
  name: "Course",
  data: {
    courseId: {
      type: DataTypes.STRING,
      allowNull: false,       //是否能为空
      primaryKey: true,       //主键
      // autoIncrement: true,    //是否自增
    },
    courseName: {
      type: DataTypes.STRING,
      allowNull: false,
    },
    classRoomId: {
      type: DataTypes.NUMBER,
      allowNull: false,
    },
    duration: {
      type: DataTypes.NUMBER,
      allowNull: false,
    },
    grade: {
      type: DataTypes.NUMBER,
      allowNull: false,
    },
    teacherId: {
      type: DataTypes.STRING,
      allowNull: false
    },
    categoryId: {
      type: DataTypes.STRING,
      allowNull: false
    },
    courseDesc: {
      type: DataTypes.STRING,
      allowNull: true
    },
    imgUrl: {
      type: DataTypes.STRING,
      allowNull: true
    },
    status: {
      type:DataTypes.NUMBER,
      allowNull: false
    },
    classTimeId: {
      type:DataTypes.STRING,
      allowNull: false
    }
  },
  options: {
      tableName: 'course_tb'
  }
}
module.exports = Course